/* eslint-disable prettier/prettier */
import { Controller, Get, Post, Body, Patch, Param, Delete, Query } from '@nestjs/common';
import { DoctorsService } from './doctors.service';
import { CreateDoctorDto } from './dto/create-doctor.dto';
import { UpdateDoctorDto } from './dto/update-doctor.dto';

@Controller('doctors')
export class DoctorsController {
  constructor(private readonly doctorsService: DoctorsService) { }

  // 添加医生接口
  // @Post()
  // create(@Body() createDoctorDto: CreateDoctorDto) {
  //   return this.doctorsService.create(createDoctorDto);
  // }

  // 查询所有医生接口
  // @Get()
  // findAll() {
  //   return this.doctorsService.findAll();
  // }

  // 根据id查找对应文章数据
  @Get('search/:id')
  async findById(@Param('id') id: string) {
    return await this.doctorsService.findOne(id);
  }

  @Get('search')
  async doSearch(@Query('input') input: string) {
    return await this.doctorsService.search(input);
  }

  // @Patch(':id')
  // update(@Param('id') id: string, @Body() updateDoctorDto: UpdateDoctorDto) {
  //   return this.doctorsService.update(+id, updateDoctorDto);
  // }

  // @Delete(':id')
  // remove(@Param('id') id: string) {
  //   return this.doctorsService.remove(+id);
  // }
}
